package com.chen.wow.day02.javaconfig.xml;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("cd-config.xml")
public class TestXML {
	@Autowired
	private BlankDisc blankDisc;
	@Autowired
	private Student student;
	@Autowired
	private BlankDisc2 compactDisc2;
	
	@Test
	public void play(){
		blankDisc.play();
		Assert.assertEquals("老师", student.getTeacher().getName());
		int age = student.getTeacher().getAge();
		Assert.assertEquals(18, age);
		compactDisc2.play();
	}

}
